using System;
using System.IO;
using StructureMap;
using Tarantino.Core;
using Tarantino.Core.Daemon.Services;

namespace Tarantino.Samples.Core.Services.Daemon
{
	[Pluggable(ServiceKeys.Secondary)]
	public class SecondFileAgent : IServiceAgent
	{
		public void Run()
		{
			string outputFile = string.Format("{0}SecondFile.txt", AppDomain.CurrentDomain.BaseDirectory);
			using (StreamWriter sw = new StreamWriter(outputFile, false))
			{
				sw.Write(DateTime.Now);
			}
		}

		public string AgentName
		{
			get { return "Second File Agent"; }
		}
	}
}